Skip to content

Build cleanly with clang 23 and current Qt; give the lims desktop client a session - #874

Merged
Yaraslaut merged 3 commits into
masterfrom
build/clang23-lifetime-safety
Oct 5, 2026
Merged

Yaraslaut merged 3 commits into
masterfrom
build/clang23-lifetime-safety

Conversation

@Yaraslaut

Copy link
Copy Markdown
Member

On a machine with clang 23 and Qt 6.11, cmake --build --preset linux-everything failed. This PR makes that build clean, with no CMake warnings, and fixes a lims GUI defect found while trying the result.

Changes

  • clang 23's lifetime-safety analysis. -Weverything turns it on and -Werror makes it fatal; it fired in about 20 places in morph's headers and in Qt's generated moc code. None of the diagnostics is a defect:

    • suggestions to annotate declarations;
    • reports that existing MORPH_LIFETIMEBOUND contracts can't be verified;
    • false invalidations, e.g. push_back on a std::vector& parameter reported as a use of out after invalidating it.

    Three groups are suppressed, because -Wno-lifetime-safety alone leaves the suggestion and lifetimebound groups on: -Wlifetime-safety, -Wlifetime-safety-suggestions and -Wlifetime-safety-lifetimebound-violation. They go through _morph_clang_suppression_if_supported, so older clang, including CI's clang 22, is unchanged.

  • QML module output directories. Qt warned at configure time that six modules had an OUTPUT_DIRECTORY that doesn't end in their target path, which stops qmllint from using the build tree as an import path. The modules are the ladder rungs, MorphForms and the forms demo. Each now writes to <binary dir>/<Uri>. The install step reads that location from the target property, so it follows the move.

  • QTP0004 is set to NEW for the modules whose .qml files sit in a subdirectory: MorphForms, the forms demo and bank_gui. It is guarded for Qt versions that predate the policy.

  • lims desktop client. Every mutating lims action refuses an empty principal, and ladder_lims_gui built its bridges without a session. So RegisterClient and every other write failed with "mutating action dispatched with an empty principal".

    • Nothing caught it: the presenter tests install a principal of their own, and the GUI smoke test dispatches nothing.
    • installDesktopSession() now lives in lims's gui_lib. main.cpp calls it in local mode.
    • A new test registers a client and a sample through a bridge set up the same way. Without the session, that test fails with the error above.

🤖 Generated with Claude Code

https://claude.ai/code/session_0141t3QdB4FkiHqiCX2M2eF2

@Yaraslaut Yaraslaut added area: ladder Subsystem: ladder area: ci Subsystem: ci labels Oct 4, 2026
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Yaraslaut and others added 3 commits October 5, 2026 04:01
Clang 23 adds a lifetime-safety analysis that -Weverything enables and
-Werror makes fatal. It raises suggestions to annotate declarations
(including in Qt's generated moc code), reports that existing
MORPH_LIFETIMEBOUND contracts cannot be verified, and false
invalidations (push_back on a vector& parameter). None is a defect, and
the analysis does not yet follow this code. The three groups are
suppressed through _morph_clang_suppression_if_supported, so older clang,
CI's included, is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141t3QdB4FkiHqiCX2M2eF2
…et QTP0004

Qt warns at configure time when a QML module's OUTPUT_DIRECTORY does not
end in its target path, because qmllint then cannot use the build tree as
an import path. Each module (the ladder rungs, MorphForms, the forms demo)
now writes to <binary dir>/<Uri>; the install step reads the location from
the target property, so it follows. Modules whose .qml files sit in a
subdirectory set QTP0004 to NEW, guarded for Qt versions that predate it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141t3QdB4FkiHqiCX2M2eF2
…efused

Every mutating lims action refuses an empty principal, and the desktop
client built its bridges without a session, so RegisterClient and every
other write failed with "mutating action dispatched with an empty
principal". The presenter tests installed a principal of their own and
the GUI smoke test dispatches nothing, so nothing exercised the client as
it ships.

installDesktopSession() now lives in gui_lib, called by main.cpp in local
mode and by a test that registers a client and a sample through a bridge
set up the same way; without the session that test fails with the error
above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141t3QdB4FkiHqiCX2M2eF2
@Yaraslaut
Yaraslaut force-pushed the build/clang23-lifetime-safety branch from 17eb74a to 308d1b8 Compare October 5, 2026 02:06
@Yaraslaut
Yaraslaut merged commit 944620c into master Oct 5, 2026
26 checks passed
@Yaraslaut
Yaraslaut deleted the build/clang23-lifetime-safety branch October 5, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci Subsystem: ci area: ladder Subsystem: ladder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant